package com.study;

import com.study.netty.client.BootNettyUdpClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication
@EnableAsync
@Slf4j
public class NettyTwoClientApplication {

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(NettyTwoClientApplication.class);
        app.run(args);

        //  向网段内的所有机器广播UDP消息，这个没试过是不是这个原理
        // new BootNettyUdpClient().bind("255.255.255.255",9999,"I am client");

        // 指定某个套接字地址和发送的内容可以发送消息
        // 该方式也可以封装成一个udp的客户端的send类
        new BootNettyUdpClient().bind("127.0.0.1",17087,"I am client");
    }
}
